/*
 * @Description: 系统通知   SystemNotification
 * @version: 
 * @Company: 
 * @Author: ZhengZhuang
 * @Date: 2019-08-26 17:28:08
 * @LastEditors: ZhengZhuang
 * @LastEditTime: 2019-08-26 18:29:50
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SystemNotification extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        children: <Widget>[
          _notificationList(),
          _notificationList(),
          _notificationList(),
          _notificationList(),
          _notificationList(),
        ],
      ),
    );
  }

  // 通知列表
  Widget _notificationList() {
    return Container(
      padding: EdgeInsets.only(
        left: ScreenUtil().setWidth(25.0),
        right: ScreenUtil().setWidth(25.0),
      ),
      child: Card(
        child: Container(
          width: ScreenUtil().setWidth(700.0),
          height: ScreenUtil().setWidth(230.0),
          padding: EdgeInsets.only(
            left: ScreenUtil().setWidth(20.0),
            right: ScreenUtil().setWidth(20.0),
          ),
          child: Column(
            children: <Widget>[
              SizedBox(
                height: ScreenUtil().setWidth(30.0),
              ),
              _notificationListTitle(),
              SizedBox(
                height: ScreenUtil().setWidth(30.0),
              ),
              _notificationListContext(),
            ],
          ),
        ),
      ),
    );
  }

  // 通知列表头部
  Widget _notificationListTitle() {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        Row(
          children: <Widget>[
            Icon(
              Icons.brightness_low,
              color: Color.fromARGB(255, 18, 150, 219),
              size: ScreenUtil().setWidth(50.0),
            ),
            SizedBox(
              width: ScreenUtil().setWidth(10.0),
            ),
            Text(
              '系统消息',
              style: TextStyle(
                fontSize: ScreenUtil().setSp(32.0),
                color: Colors.black87,
              ),
            ),
          ],
        ),
        Text(
          '2019.08.09 12:33',
          style: TextStyle(
            fontSize: ScreenUtil().setSp(28.0),
            color: Colors.black38,
          ),
        ),
      ],
    );
  }

  // 系统消息内容
  Widget _notificationListContext() {
    return Text(
      '送您最高20元夏日跑单加油新人福利，叠加最低9折加油折扣，每月油钱最高省500元！点击领取跑单加油新人福利，叠加最低9折加油折扣，每月油钱最高省500元！点击领取',
      overflow: TextOverflow.ellipsis,
      maxLines: 2,
      style: TextStyle(
        fontSize: ScreenUtil().setSp(28.0),
        color: Colors.black54,
      ),
    );
  }
}
